package com.ye.personnel.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum FlowTypeEnum {

    LY(1,"录用"),
    JAZ(2,"军转安置"),
    DR(3,"调任"),
    TB(4,"职务变动(提拔、免职)"),
    JL(5,"职务变动(交流)"),
    ZJB(6,"职级变动"),
    ZR(7,"转任"),
    DJ(8,"公务员登记"),
    TX(9,"退休"),
    DC(10,"调出"),
    CZ(11,"辞职"),
    CT(12,"辞退"),
    KC(13,"开除"),
    QX(14,"取消录用");

    public Integer type;
    public String name;

    public static String getName(Integer type){
        FlowTypeEnum orderStatusEnum = Stream.of(values())
                .filter(t -> t.type.equals(type))
                .findFirst()
                .orElse(LY);
        return orderStatusEnum.getName();
    }
}
